<?php
/**
 * @version SVN: $Id$
 * @package    fmcSeminaire
 * @subpackage Views
 * @author     EasyJoomla {@link http://www.easy-joomla.org Easy-Joomla.org}
 * @author     Ludovic Launer {@link }
 * @author     Created on 28-Nov-10
 * @license    GNU/GPL
 */
$document = &JFactory::getDocument();
$document->addScript('../includes/js/jquery/jquery.js' );
$document->addScript('../includes/js/jquery/jquery.selectboxes.js' );
//-- No direct access
defined('_JEXEC') or die('=;)');

include_once JPATH_ADMINISTRATOR . DS. 'components/com_content/elements/article.php';	// Article selector

JHTML::_('behavior.tooltip');
?>
<script type="text/javascript">

// ------------------------------------------------------------------------------------
$.noConflict();
jQuery(document).ready(function(){ 
// ------------------------------------------------------------------------------------ 

jQuery("#campagneId").ajaxAddOption("index.php?option=com_fmcseminaire&controller=analyse&task=gtCampagneListData",
									{},
									false,
									setSelectedOption
									);

jQuery("#campagneId").change(function() {
	var selectedValue = jQuery("#campagneId").selectedValues()[0];

	//alert(selectedValue);

	});
//------------------------------------------------------------------------------------ 
//alert('<?php echo $this->item->campagneId;?>');


function setSelectedOption()
{
	jQuery("#campagneId").val('<?php echo $this->item->campagneId;?>');
}
//------------------------------------------------------------------------------------ 
});
</script>

	

<form action="index.php" method="post" name="adminForm" id="adminForm">
<div class="col100">
	<fieldset class="adminform">
		<legend><?php echo JText::_('Details'); ?></legend>

		<table class="admintable">
		<tr>
			<td width="100" align="right" class="key">
					<?php echo JText::_('Campagne'); ?>:
			</td>
			<td>
				<select id="campagneId" name="campagneId">
				</select>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">
				<label for="greeting">
					<?php echo JText::_('Titre du s&eacute;minaire'); ?>:
				</label>
			</td>
			<td>
				<input class="text_area" type="text" name="greeting" id="greeting" size="80" maxlength="250" value="<?php echo $this->item->greeting;?>" />
			</td>
			<td width="100" align="right" class="key">
				<label for="greeting">
					<?php echo JText::_('Article descriptif'); ?>:
				</label>
			</td>
			<td>
				<?php
				// --- Article selector ---
				if (class_exists( 'JElementArticle' )) {
      				$articleSelectBox = new JElementArticle();
      				echo $articleSelectBox->fetchElement('content_id', $this->item->content_id,$a=null, 'selected_article');
   					}	 
				?>
			</td>
		</tr>
	</table>
	</fieldset>
</div>
<div class="clr"></div>

<input type="hidden" name="option" value="com_fmcseminaire" />
<input type="hidden" name="seminaireId" value="<?php echo $this->item->seminaireId; ?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="controller" value="fmcseminaire" />
</form>